package govenor.status;

public class FileStoreStatus {

	private int numberOfDownloads;
	private double averageServiceTime;
	private long quickestServiceTime;
	private long slowestServiceTime;
	private String filename;

	public FileStoreStatus(){
		this.numberOfDownloads = 0;
		this.averageServiceTime = 0;
		this.quickestServiceTime = 0;
		this.slowestServiceTime = 0;
		this.filename = "";
	}
	public FileStoreStatus(int numberOfDownloads, double averageServiceTime,
			long quickestServiceTime, long slowestServiceTime) {
		this.numberOfDownloads = numberOfDownloads;
		this.averageServiceTime = averageServiceTime;
		this.quickestServiceTime = quickestServiceTime;
		this.slowestServiceTime = slowestServiceTime;
		this.filename = "";
	}
	public FileStoreStatus(int numberOfDownloads, double averageServiceTime,
			long quickestServiceTime, long slowestServiceTime,String filename) {
		this.numberOfDownloads = numberOfDownloads;
		this.averageServiceTime = averageServiceTime;
		this.quickestServiceTime = quickestServiceTime;
		this.slowestServiceTime = slowestServiceTime;
		this.filename = filename;
	}
	public int getNumberOfDownloads() {
		return numberOfDownloads;
	}
	public void setNumberOfDownloads(int numberOfDownloads) {
		this.numberOfDownloads = numberOfDownloads;
	}
	public double getAverageServiceTime() {
		return averageServiceTime;
	}
	public void setAverageServiceTime(double averageServiceTime) {
		this.averageServiceTime = averageServiceTime;
	}
	public long getQuickestServiceTime() {
		return quickestServiceTime;
	}
	public void setQuickestServiceTime(long quickestServiceTime) {
		this.quickestServiceTime = quickestServiceTime;
	}
	public long getSlowestServiceTime() {
		return slowestServiceTime;
	}
	public void setSlowestServiceTime(long slowestServiceTime) {
		this.slowestServiceTime = slowestServiceTime;
	}
	public String getFilename() {
		return filename;
	}
	public void setFilename(String filename) {
		this.filename = filename;
	}
	//Compares which is better,if number is > 0 then the callee is best
	//If < 0 compared object is better
	//If == 0 then both hosts are the same and the test is abritary
	public int compare(FileStoreStatus stat){
		int temp = 0;
		
		if(stat.getAverageServiceTime() < this.averageServiceTime){
			temp--;
		}else{
			temp++;
		}
		if(stat.getNumberOfDownloads() < this.numberOfDownloads){
			temp--;
		}else{
			temp++;
		}
		if(stat.getQuickestServiceTime() < this.quickestServiceTime){
			temp--;
		}else{
			temp++;
		}
		if(stat.slowestServiceTime < this.slowestServiceTime){
			temp--;
		}else{
			temp++;
		}
		
		return temp;
	}
	
	
	
	
}
